<%@page import="study.top.mydb.items.MemberItem"%>
<%@page import="study.top.mydb.Reply"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %>
<%@ page session="true" %>
<%@ include file="dbcon.jsp" %>
<%

		boolean login = false;
		int mem_seq = 0;
		
		MemberItem memberItem = (MemberItem) session
				.getAttribute("MemberItem");
		
		if (memberItem != null) {
			login = true;
			mem_seq = memberItem.getSeq();
		}
		
		if(mem_seq <= 0) {
			web.goPage(null, "삭제가 불가능합니다.");
			return;
		}

		int board_seq = web.getInt("seq");
		int rp_seq = web.getInt("re_seq");
		
		if (rp_seq < 0) {
			web.goPage(null, "파라미터가 없습니다1.");
			db.disconnect();
			return;
		}
		
		Reply reply = new Reply();
		boolean result = reply.delete(rp_seq, mem_seq);
		
		db.disconnect();
		
		if (!result) {
			web.goPage(null, "시스템 상의 이유로 삭제되지 않았습니다.");
			return;
		}
		
		web.goPage("uBrdQAView.jsp?seq="+board_seq, "삭제되었습니다.");
%>